package com.xxxy.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.xxxy.blockhandler.MonitorBlockHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/monitor")
public class MonitorController {

    @GetMapping("/hello")
    @SentinelResource(value = "HelloResource",blockHandler = "handler",
            blockHandlerClass = MonitorBlockHandler.class)
    public String hello(){
        return "hello world";
    }


    @GetMapping("/hello2")
    @SentinelResource(value = "HelloResource2",blockHandler = "handler",
            blockHandlerClass = MonitorBlockHandler.class)
    public String hello2(){
        return "关联接口";
    }
}
